import React from 'react';
import { AppstoreFilled, MenuOutlined } from '@ant-design/icons';
import { connect } from 'umi';
const Showway = (props)=>{
    const {showWay,color,dispatch}=props;
    return (
        <div>
            <AppstoreFilled style={{ fontSize: 22, marginRight: 15, color: `${showWay == "square" ? color? color :"#1890ff" : "#000"}` }} onClick={() => {
                            dispatch({
                                type: 'global/showWay',
                                payload: "square",
                            });
                        }} />
                        <MenuOutlined style={{ fontSize: 21, color: `${showWay == "list" ? color? color :"#1890ff" : "#000"}` }} onClick={() => {
                            dispatch({
                                type: 'global/showWay',
                                payload: "list",
                            });
                        }} />
        </div>
    )
}

export default connect(({ global }) => ({
    showWay: global.showWay
}))(Showway)